package com.jinyou.chengfengshop.payUtils;

import android.content.Context;

import com.tencent.mm.sdk.modelpay.PayReq;
import com.tencent.mm.sdk.openapi.IWXAPI;
import com.tencent.mm.sdk.openapi.WXAPIFactory;

public class WXPayUtil {
	
	public static void pay(Context mContext, String appId, String partnerId, String prepayId,
                           String packageValue, String nonceStr, String timeStamp, String sign){
		IWXAPI msgApi = WXAPIFactory.createWXAPI(mContext, "wxf79b330bbebfa11c",false);
		msgApi.registerApp(appId);
		PayReq request = new PayReq();
		request.appId = appId;
		request.partnerId = partnerId;
		request.prepayId = prepayId;
		request.packageValue = packageValue;
		request.nonceStr = nonceStr;
		request.timeStamp = timeStamp;
		request.sign= sign;
//		OurSystem.out("-----------发起appId :" + appId);
//		OurSystem.out("-----------发起partnerId :" + partnerId);
//		OurSystem.out("-----------发起prepayId :" + prepayId);
//		OurSystem.out("-----------发起packageValue :" + packageValue);
//		OurSystem.out("-----------发起nonceStr :" + nonceStr);
//		OurSystem.out("-----------发起timeStamp :" + timeStamp);
//		OurSystem.out("-----------发起sign :" + sign);
		Boolean isSend = msgApi.sendReq(request);
//		OurSystem.out("--------------sendReg:" + isSend);
	}
}